<include file="public@header"/>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="layui-input" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}" title="图片名称" style="width:200px;">
   
        <img id="photo-{id}-preview" src="{url}" onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('{:lang('UPLOAD_IMAGE')}','#photo-{id}');">{:lang('REPLACE')}</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">{:lang('REMOVE')}</a>
    </li>
</script>
<script type="text/html" id="files-item-tpl">
    <li id="saved-file{id}">
        <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
        <input class="layui-input" id="file-{id}-name" type="text" name="file_names[]" value="{name}" title="文件名称" style="width:200px;">
        <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
        <a href="javascript:uploadOne('附件上传','#file-{id}','file');">{:lang('REPLACE')}</a>
        <a href="javascript:(function(){$('#saved-file{id}').remove();})();">{:lang('REMOVE')}</a>
    </li>
</script>
</head>
<body>
<div class="layui-fluid js-check-wrap">
    <div class="layui-card">
        <div class="layui-card-header">添加会议室</div>
        <form action="{:url('AdminMeeting/addPost')}" method="post" class="layui-form js-ajax-form" data-replace="1">
            <div class="layui-card-body">
                <div class="layui-tab">
                    <div class="layui-tab-content">
                        <div class="layui-tab-item layui-show">
                            <div class="layui-card-body">
                                <!-- 列表标题 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">会议列表标题</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input form-replace" type="text" name="post[list_title]" data-field="list_title"
                                                placeholder="{:lang('PLEASE_ENTER')}会议列表标题"/>
                                    </div>
                                </div>
                                <!-- 列表副标题 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">会议列表副标题</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input form-replace" type="text" name="post[list_subtitle]" data-field=list_subtitle"
                                                placeholder="{:lang('PLEASE_ENTER')}会议列表副标题"/>
                                    </div>
                                </div>
                                <!-- 内容标题 -->
                                <!-- <div class="layui-form-item">
                                    <label class="layui-form-label">会议详情标题</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input form-replace" type="text" name="post[title]" data-field="title"
                                                placeholder="{:lang('PLEASE_ENTER')}会议详情标题"/>
                                    </div>
                                </div> -->
                                <!-- 简介 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">会议室简介</label>
                                    <div class="layui-input-block">
                                        <textarea type="text" class="layui-textarea" id="input-remark" name="post[intro]"></textarea>
                                    </div>
                                </div>
                                <!-- 是否需要预定时选择会议类型 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">是否需要预定时选择会议类型</label>
                                    <div class="layui-input-block">

                                        <!-- 单选分类 -->
                                        <select class="layui-input" name="post[is_type]">
                                            <option value=''>{:lang('SELECT_PLEASE')}</option>
                                            <option value='0'>不需要</option>
                                            <option value='1'>需要</option>
                                        </select>
                                    </div>
                                </div>
                                <!-- 是否需要预定时选择主席台布置 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">是否需要预定时选择主席台布置</label>
                                    <div class="layui-input-block">

                                        <!-- 单选分类 -->
                                        <select class="layui-input" name="post[is_layout]">
                                            <option value=''>{:lang('SELECT_PLEASE')}</option>
                                            <option value='0'>不需要</option>
                                            <option value='1'>需要</option>
                                        </select>
                                    </div>
                                </div>
                                <!-- 对外价格 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">对外价格</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input form-replace" type="text" name="post[out_price]" data-field="out_price"
                                                placeholder="{:lang('PLEASE_ENTER')}对外价格"/>
                                    </div>
                                </div>
                                <!-- 对内价格 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">对内价格</label>
                                    <div class="layui-input-block">
                                        <input class="layui-input form-replace" type="text" name="post[in_price]" data-field="in_price"
                                                placeholder="{:lang('PLEASE_ENTER')}对内价格"/>
                                    </div>
                                </div>                
                            </div>
                        </div>

                    
                    </div>
                </div>

                <div class="layui-form-item padding-left-25">
                    <div class="layui-input-block">
                        <button type="button" class="layui-btn layui-btn-normal" onclick="CheckSenSubmit();" id="add-key">{:lang('ADD')}</button>
                        <button type="submit" class="layui-btn layui-btn-normal js-ajax-submit" style="display:none;" id="js-ajax-submit">{:lang('ADD')}</button>
                        <a class="layui-btn layui-btn-primary" href="javascript:history.back(-1);">{:lang('BACK')}</a>
                    </div>
                </div>
            </div>

        </form>
    </div>
</div>

<include file="public@footer"/>
<include file="admin@theme/scripts"/>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.js"></script>
<script type="text/javascript">
    $(function () {
        if( $('#detail_content').length ){
            // $('.content-preview').show();
            UE.getEditor('detail_content');
        }
        if( $('#post_excerpt').length ){
            UE.getEditor('post_excerpt');
        }
        //移除缩略图
        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });

    });

    // 选择分类
    function doSelectCategory() {
        var selectedCategoriesId = $('#js-categories-id-input').val();
        openIframeLayer("{:url('AdminCategory/select')}?operate=add&ids=" + selectedCategoriesId, '请选择分类', {
            area: ['700px', '400px'],
            btn: ['确定', '取消'],
            yes: function (index, layero) {
                //do something

                var iframeWin          = window[layero.find('iframe')[0]['name']];
                var selectedCategories = iframeWin.confirm();
                if (selectedCategories.selectedCategoriesId.length == 0) {
                    layer.msg('请选择分类');
                    return;
                }
                $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
                $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
                //console.log(layer.getFrameIndex(index));
                layer.close(index); //如果设定了yes回调，需进行手工关闭
            }
        });
    }
</script>
